add_executable( asio_thread_demo asio_thread_test.cpp ../asio_thread.cpp )
target_include_directories( asio_thread_demo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ )
target_link_libraries(asio_thread_demo PRIVATE
        spdlog::spdlog
        asio::asio
        fmt::fmt
)

add_executable( thread_test thread_test.cpp ../t_thread.cpp)
target_include_directories( thread_test PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/../ )
target_link_libraries( thread_test PRIVATE fmt::fmt )

add_executable( thread_pool_test thread_pool_test.cpp )
target_include_directories( thread_pool_test PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ )
target_link_libraries(thread_pool_test PRIVATE
        spdlog::spdlog
        asio::asio
        fmt::fmt
)


if (WIN32)
    # 导出CANCONTROL_API 到lib中
    target_compile_definitions(asio_thread_demo PRIVATE TWBLF_EXPORTS)
    # 链接Windows所需标准库
    target_link_libraries(asio_thread_demo PRIVATE ws2_32 iphlpapi winmm)
    # 指定Windows版本
    target_compile_definitions(asio_thread_demo PRIVATE _WIN32_WINNT=0x0A00)

    # 导出CANCONTROL_API 到lib中
    target_compile_definitions(thread_test PRIVATE TWBLF_EXPORTS)
    # 链接Windows所需标准库
    target_link_libraries(thread_test PRIVATE ws2_32 iphlpapi winmm)
    # 指定Windows版本
    target_compile_definitions(thread_test PRIVATE _WIN32_WINNT=0x0A00)

    # 导出CANCONTROL_API 到lib中
    target_compile_definitions(thread_pool_test PRIVATE TWBLF_EXPORTS)
    # 链接Windows所需标准库
    target_link_libraries(thread_pool_test PRIVATE ws2_32 iphlpapi winmm)
    # 指定Windows版本
    target_compile_definitions(thread_pool_test PRIVATE _WIN32_WINNT=0x0A00)
endif ()